using System;

using PowerPoint = Microsoft.Office.Interop.PowerPoint;

using Outcoding.GraphGenerator.Entities;

namespace Outcoding.GraphGenerator.Generator.Util {
    public class SlideLayoutHelper {
        public static PowerPoint.PpSlideLayout GetPPSlideLayout(Entities.SlideLayout layout) {

            PowerPoint.PpSlideLayout ppLayout = Microsoft.Office.Interop.PowerPoint.PpSlideLayout.ppLayoutBlank;
            switch (layout) {
                case SlideLayout.ppLayoutBlank:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutBlank;
                    break;
                case SlideLayout.ppLayoutTitleOnly:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutTitleOnly;
                    break;
                case SlideLayout.ppLayoutTitle:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutTitle;
                    break;
                case SlideLayout.ppLayoutLargeObject:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutLargeObject;
                    break;
                case SlideLayout.ppLayoutText:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutText;
                    break;
                case SlideLayout.ppLayoutTwoColumnText:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutTwoColumnText;
                    break;
                case SlideLayout.ppLayoutObjectOverText:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutObjectOverText;
                    break;
                case SlideLayout.ppLayoutTextAndTwoObjects:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutTextAndTwoObjects;
                    break;
                case SlideLayout.ppLayoutTwoObjectsAndText:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutTwoObjectsAndText;
                    break;
                case SlideLayout.ppLayoutTwoObjectsOverText:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutTwoObjectsOverText;
                    break;
                case SlideLayout.ppLayoutFourObjects:
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutFourObjects;
                    break;
                case SlideLayout.ppLayoutCustom:      //future development, unknown layout for now
                    ppLayout = PowerPoint.PpSlideLayout.ppLayoutBlank;
                    break;
                default:
                    break;
            }
            return ppLayout;
        }

        public static Entities.SlideLayout GetSlideLayout(PowerPoint.PpSlideLayout ppLayout) {

            Entities.SlideLayout layout = SlideLayout.ppLayoutUnknown;
            switch (ppLayout) {
                case PowerPoint.PpSlideLayout.ppLayoutBlank:
                    layout = SlideLayout.ppLayoutBlank;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutTitleOnly:
                    layout = SlideLayout.ppLayoutTitleOnly;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutTitle:
                    layout = SlideLayout.ppLayoutTitle;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutLargeObject:
                    layout = SlideLayout.ppLayoutLargeObject;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutText:
                    layout = SlideLayout.ppLayoutText;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutTwoColumnText:
                    layout = SlideLayout.ppLayoutTwoColumnText;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutObjectOverText:
                    layout = SlideLayout.ppLayoutObjectOverText;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutTextAndTwoObjects:
                    layout = SlideLayout.ppLayoutTextAndTwoObjects;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutTwoObjectsAndText:
                    layout = SlideLayout.ppLayoutTwoObjectsAndText;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutTwoObjectsOverText:
                    layout = SlideLayout.ppLayoutTwoObjectsOverText;
                    break;
                case PowerPoint.PpSlideLayout.ppLayoutFourObjects:
                    layout = SlideLayout.ppLayoutFourObjects;
                    break;
                default:
                    break;
            }
            return layout;
        }
    }
}
